﻿cmake_minimum_required(VERSION 3.15)
project(COSI)

#find_package(Eigen3 REQUIRED)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-O2 -fPIC")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
include_directories("${PROJECT_SOURCE_DIR}/include")

option(WIN_BUILD "build for windows" OFF)

FIND_PACKAGE(OpenMP REQUIRED)
if (OPENMP_FOUND)
 message("OPENMP FOUND")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif ()


if (WIN_BUILD)
 add_definitions(-DWIN_BUILD)
endif()

aux_source_directory("${PROJECT_SOURCE_DIR}/src/" SRC_LIST)
aux_source_directory("${PROJECT_SOURCE_DIR}/src/cosi" SRC_LIST)
aux_source_directory("${PROJECT_SOURCE_DIR}/include/cosi" LIB_LIST)
#message(${SRC_LIST})
add_library(COSI SHARED ${SRC_LIST} ${LIB_LIST})
#add_library(COSI SHARED
#    ${PROJECT_SOURCE_DIR}/src/si.cpp
#    ${PROJECT_SOURCE_DIR}/src/si_SL.cpp
#    ${PROJECT_SOURCE_DIR}/src/c_extern.cpp
#        include/cosi/objectives.h src/objectives.cpp
#        include/cosi/node_stats.h
#        include/cosi/global_stats.h src/global_stats_stl.cpp include/cosi/global_stats_stl.h)
